# -*- coding: utf-8 -*-
#!/usr/bin/python
# linecount.py
# 2009-1-20
# author:
#	Jason Lee 
# 
import sys
import os

exts = ['.java']
def read_line_count(fname):
    count = 0
    for file_line in open(fname).xreadlines():
        count += 1
    return count

if __name__ == '__main__':
    count = 0
    fcount = 0
    print 'test'
    for root, dirs, files in os.walk(os.getcwd()):
        for f in files:
            # Check the sub directorys			
            fname = os.path.join(root, f)
            #  print fname
            try:
                ext = f[f.rindex('.'):]
                if(ext == '.java'):
                    print f 
                    fcount += 1
                    c = read_line_count(fname)
                    count += c
            except:
                pass
    print 'file count:%d' % fcount
    print 'count:%d' % count
